/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package camada.bancodedados.daoimplemente;

import eloma.classe.Juridica;
import camada.bancodedados.conexao.Conexao;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 *
 * @author Icaro
 */
public class JuridicaDAOImpl {

    public void inserirJuridica(Juridica juridica) {
        PreparedStatement pstm = null;
        try {
            final String SQL_INSERT
                    = "insert into juridica(Contato,CNPJ,IE,IM)values(?,?,?,?)";
            pstm = Conexao.getCon().prepareStatement(SQL_INSERT);
            pstm.setString(1, juridica.getContato());
            pstm.setString(2, juridica.getCnpj());
            pstm.setString(3, juridica.getIe());
            pstm.setString(4, juridica.getIm());
            pstm.executeUpdate();
        } catch (SQLException e) {
            System.out.println("Erro ao inserir dados!!!\n" + e.getMessage());
        }
    }

}
